package com.easybuy.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.easybuy.dao.GoodsDao;
import com.easybuy.entity.Goods;
import com.easybuy.service.GoodsService;

@Service("goodsService")
public class GoodsServiceImpl implements GoodsService {

	@Autowired
	private GoodsDao goodsDao;

	public void add(Goods goods) {
		goodsDao.add(goods);
	}

	public List<Goods> getList(String name, int brandId, int typeId, int first,
			int maxResult) {
		return goodsDao.getList(name, brandId, typeId, first, maxResult);
	}

	public int getCount(String name, int brandId, int typeId) {
		return goodsDao.getCount(name, brandId, typeId);
	}

	public List<Goods> getHotGoods(int maxResult) {
		return goodsDao.getHotGoods(maxResult);
	}

	public List<Goods> getTypeHotGoods(int typeId, int maxResult) {
		return goodsDao.getTypeHotGoods(typeId, maxResult);
	}

	public Goods getById(int id) {
		return goodsDao.getById(id);
	}

}
